#!/usr/bin/perl
use strict;
use warnings;
use autodie;

# use Getopt::Std;

# getopts('p', \%opts);

# if ( defined $opts{f}) {
	# my @high=("PASS");
# }

open in, $ARGV[0];
open OUT1, ">$ARGV[1]";
open OUT2, ">$ARGV[2]";
open OUT3, ">$ARGV[3]";

my $high="PASS";

while(<in>) {
	if(! /^#/) {
	
		my @vcf = split '\t', $_;
		if($vcf[6] =~ /^$high$/) {
			print OUT1 $_;
		}else{
			print OUT2 $_;
		}
	}else{
		print OUT3 $_;
	}
}

